$(function(){
    $("#find").keyup(function () {
        var filter = $(this).val();
        $(".name").each(function(){
            var text = $(this).text();
            if ($(this).text().search(new RegExp(filter, "i")) < 0) {
                $(this).parent().parent().parent().hide();
            } else{
                $(this).parent().parent().parent().show();
            }
        });
        if(filter ==""){
        	$(".title").show();
        }else{
        	$(".title").hide();
        }
        var count = $(".list-view li:visible").size();
        $(".count").html("共计"+count+"人");
    });
    getInfoList();
});
function getInfoList(){
    var $groupid = window.localStorage.getItem("groupId");
    var $token =window.localStorage.getItem("token");
    var $mid = window.localStorage.getItem("mid");
    var Post ="mid="+$mid+"&groupid="+$groupid+"&pagesize=5&token="+$token+"&did=44444";
    $.ajax({
    	url:'../../api/group/getgroupcontactlist',
    	type:'post',
    	data:Post,
    	success:function(msg){
    		if(msg.code ==100){
    			console.log(msg);
    			for(var i=0; i< msg.data.length;i++){   
    				
    					/*lis=document.createElement("li");
    					lis.class="listview";
    					lis.innerHTML='<p>'+msg.data[i].n0+'</p>';
    	    			$("#professinal").append(lis);*/
    				for (var j = 0; j < msg.data[i].n5.length; j++) {
    					console.log(msg.data[i].n5[j].n0);
    	    			li = document.createElement("li");
    	    			li.innerHTML='<a href="../mine/selvesInfo.html?bid='+
    	    			msg.data[i].n5[j].n0+'&tel='+
    	    			msg.data[i].n5[j].n4+'"<div class="addressInfo">'+
    	    			'<div class="addressListLeft">'+
    	    			'<img src="'+
    	    			msg.data[i].n5[j].n1+'">'+
    	    			'</div><div class="addressListRight">'+
    	    			'<h5>'+msg.data[i].n0+'</h5><p>'+msg.data[i].n5[j].n2+'</p><p>'+msg.data[i].n5[j].n3+'</p></div></div></a>';  	    			
    	    			/*li.innerHTML ='<a href="member_info.html?bid='+
    	    			msg.data[i].n5[j].n0+'&tel='+
    	    			msg.data[i].n5[j].n4+'"><img src="'+
    	    			msg.data[i].n5[j].n1+'"><div class="personal-info"><span class="name">'+
    	    			msg.data[i].n5[j].n2+'</span><span class="position">'+
    	    			msg.data[i].n0+'</span></div></a>';*/
    	    			$("#professinal").append(li);
					}   	    			
    			}    			
    		    var count = $(".list-view li:visible").size();
    		    $(".count").html("共计"+count+"人");
    		}
    	}
    });
}        
        
function getUrlParam(name) {
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
	var r = window.location.search.substr(1).match(reg);
	if (r != null) return unescape(r[2]); return null;
}        